<!-- Copyright 2013 Google Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// -->
<!DOCTYPE html>
<title>Unit Test of e2e.cryptcompression.Zlib</title>
<script src="../../../closure/base.js"></script>
<script src="test_js_deps-runfiles.js"></script>
<script>
  goog.require('e2e');
  goog.require('e2e.compression.Zlib');
  goog.require('goog.array');
  goog.require('goog.testing.jsunit');
</script>
<script>
/**
 * Tests that decompress works.
 */
function testDecompress() {
  var compressedData = [0x78, 0x9c, 0x4b, 0xcf, 0xcf, 0x4f, 0x49, 0xaa, 0x4c,
                        0xd5, 0x51, 0x28, 0xcf, 0x2f, 0xca, 0x49, 0x01, 0x00,
                        0x28, 0xa5, 0x05, 0x5e];


  var algo = new e2e.compression.Zlib();
  var decompressedData = e2e.async.Result.getValue(algo.decompress(compressedData));
  assertEquals(e2e.byteArrayToString(decompressedData),
               "goodbye, world");
}

</script>
